package com.xxx.hhh.demo.demo8;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ServerDemo {
    public static void main(String[] args) throws IOException {
//        创建对象
        ServerSocket ss = new ServerSocket(10300);
        ExecutorService es = Executors.newFixedThreadPool(20);
        while (true) {

            Socket socket = ss.accept();
            UpdateFileRunnable uf = new UpdateFileRunnable(socket);
            es.submit(uf);
//        ss.close();
        }
    }
}